import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;


/**
 * Created with IntelliJ IDEA.
 * User: Chris
 * Date: 11/2/13
 * Time: 10:55 PM
 * To change this template use File | Settings | File Templates.
 */
public class CandyStore
{
    public static void main(String[] args)
    {
        System.out.println(new CandyStore().candyStore());
    }

    class Candy
    {
        public Integer calories;
        public Double price;
        public Double ratio;

        public Candy(Integer c, Double p)
        {
            this.calories = c;
            this.price = p;
            this.ratio = c/p;
        }


    }

    public class CustomComparator implements Comparator<Candy> {
        @Override
        public int compare(Candy o1, Candy o2)
        {
            return o1.ratio.compareTo(o2.ratio);
        }
    }
    public int candyStore()
    {
        ArrayList<Integer> calories = new ArrayList<Integer>();
        ArrayList<Double> prices = new ArrayList<Double>();
        ArrayList<Candy> candies = new ArrayList<Candy>();

        int numCandies = 0;
        double money = 0;
        double maxCalories = 0;
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String[] halves = s.split(" ");
        numCandies = Integer.parseInt(halves[0]);
        money = Double.parseDouble(halves[1]);


        while(!s.equals("0 0.00"))
        {
            s = scan.nextLine();
            halves = s.split(" ",2);
            calories.add(Integer.parseInt(halves[0]));
            prices.add(Double.parseDouble(halves[1]));
        }

        for(int i = 0; i< calories.size(); i++)
        {
            candies.add(new Candy(calories.get(i),prices.get(i)));
        }

        Collections.sort(candies, new CustomComparator());

        while(money > 0)
        {
            maxCalories += candies.get(numCandies).calories;
            money -=  candies.get(numCandies).price;
            numCandies--;
        }
       return (int)maxCalories;
    }
}


